drop table jms_dm.dm_tab_center_weight_rate_way_detail_dt; --循环袋建包明细;
CREATE TABLE jms_dm.dm_tab_center_weight_rate_way_detail_dt
(
    flag              int comment '未称重类型:1单件未称重 2包件未称重',
    billcode          varchar(50) comment '运单号',
    site_code         varchar(50) comment '中心到件扫描的网点code',
    proxy_area_code   varchar(50) comment '代理区',
    site_name         varchar(100) comment '中心到件扫描的网点名称',
    proxy_area_name   varchar(100) comment '代理区',
    scan_time         varchar(100) comment '扫描时间',
    scan_user_code    varchar(50) comment '扫描人code',
    scan_user         varchar(100) comment '扫描人',
    pistol_id         varchar(100) comment '设备编码',
    source            varchar(100) comment '数据来源',
    pick_network_code varchar(50) comment '寄件网点编码',
    pick_network_name varchar(100) comment '寄件网点名称',
    date_time         date comment '日期'
) ENGINE = OLAP DUPLICATE KEY(flag,billcode, site_code, proxy_area_code)
COMMENT "中心出港称重率报表明细"
PARTITION BY RANGE(date_time)
(START ("2022-06-01") END ("2022-07-15") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(`billcode`) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);

